<template>
  <page-header-wrapper>
    <a-card style="padding: 10px;box-sizing: border-box;">
      <a-row>
        <a-col v-if="$access('ENT_OPER_TOOL_INFO_COMPARE_MCH')" :span="3">
          <div class="block" @click="compareMchInfo()">
            <img
              class="img"
              src="https://jdyd-marketing-public.oss-cn-hangzhou.aliyuncs.com/yx/87f44c77-dcad-44a7-badc-ead9ee1512c7.png"
              alt=""
            >
            <div class="title">商户数据对比</div>
          </div>
        </a-col>
        <!-- <a-col v-if="$access('ENT_COMPARE_MCHINFO_DECRYPT')" :span="3">
          <div class="block" @click="dataDecrypt()">
            <img
              class="img"
              src="https://jdyd-marketing-public.oss-cn-hangzhou.aliyuncs.com/yx/4927b907-3690-40e7-8173-a9cc1fc1dea0.png"
              alt=""
            >
            <div class="title">数据解密</div>
          </div>
        </a-col> -->
        <a-col v-if="$access('ENT_OPER_TOOL_INFO_RESET_MCHNO')" :span="3">
          <div class="block" @click="resetMchNo()">
            <img
              class="img"
              src="https://jdyd-marketing-public.oss-cn-hangzhou.aliyuncs.com/yx/96917c60-e412-42aa-94e3-4893367d6e17.png"
              alt=""
            >
            <div class="title">重置商户号</div>
          </div>
        </a-col>
        <!-- https://hn-jrst.obs.cn-hazz1.ctyun.cn/marketing/65d128ff-dc9a-47f2-9968-97f850c1b3a3.png -->
        <a-col v-if="$access('ENT_OPER_TOOL_INFO_MATCH')" :span="3">
          <div class="block" @click="dataMatch()">
            <img
              class="img"
              src="https://hn-jrst.obs.cn-hazz1.ctyun.cn/marketing/65d128ff-dc9a-47f2-9968-97f850c1b3a3.png"
              alt=""
            >
            <div class="title">数据匹配</div>
          </div>
        </a-col>
        <a-col v-if="$access('ENT_OPER_TOOL_INFO_SCORE_DISBT')" :span="3">
          <div class="block" @click="sendScore()">
            <img
              class="img"
              src="https://jdyd-test.oss-cn-hangzhou.aliyuncs.com/henan/activity/206e4e79-202a-4b87-85e6-2c342e2da8f6.png"
              alt=""
            >
            <div class="title">福分发放</div>
          </div>
        </a-col>
        <a-col :span="3" />
        <a-col :span="3" />
        <a-col :span="3" />
      </a-row>
    </a-card>
    <a-row>
      <a-col>
        <!-- <a-row style="padding-bottom: 20px;">
            <a-button type="primary" @click="compareMchInfo()">商户数据对比</a-button>
        </a-row>
        <a-row style="padding-bottom: 20px;">
            <a-button type="primary" @click="dataDecrypt()">数据解密</a-button>
        </a-row>
        <a-row style="padding-bottom: 20px;">
            <a-button type="primary" @click="resetMchNo()">重置商户号</a-button>
        </a-row> -->
        
        <!-- <div class="container">
        <div class="col" @click="gotoAdd">
          <div class="block">
            <img
              class="img"
              src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
              alt=""
            />
            <div class="title">商户数据对比</div>
          </div>
          <div class="block">
            <img
              class="img"
              src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
              alt=""
            />
            <div class="title">数据解密</div>
          </div>
          <div class="block">
            <img
              class="img"
              src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
              alt=""
            />
            <div class="title">重置商户号</div>
          </div>
        </div>
      </div> -->
      </a-col>
    </a-row>
    <AddOrEditCM ref="addOrEditRef" :callBackFunc="searchFunc" />
    <AddOrEditD ref="addOrEditRefD" />
    <AddOrEditMchNo ref="addOrEditMchNo" />
    <AddOrEditDM ref="addOrEditDMRef" />
    <SendScoreDrawer ref="sendScoreDrawer" />
  </page-header-wrapper>
</template>
<script setup lang="ts">
// 以上图标皆来自阿里图标库
import {ref, getCurrentInstance} from 'vue'
const { $infoBox, $access } = getCurrentInstance()!.appContext.config.globalProperties
import AddOrEditCM from './compareMchinfo/index.vue'
import AddOrEditD from './dataDecrypt/AddOrEditD.vue'
import AddOrEditMchNo from './resetMchNo/AddOrEditMchNo.vue'
import AddOrEditDM from './dataMatch/AddOrEditDM.vue'
import SendScoreDrawer from './sendScore/SendScore.vue'


const addOrEditRef = ref()
const addOrEditRefD = ref()
const addOrEditMchNo = ref()
const addOrEditDMRef = ref()
const sendScoreDrawer = ref()


// 商户数据对比
function compareMchInfo(){
    addOrEditRef.value.show()
}
// 数据解密
function dataDecrypt(){
    addOrEditRefD.value.show()
}
// 重置商户号
function resetMchNo(){
    addOrEditMchNo.value.show()
}

//数据匹配
const dataMatch = () =>{
  addOrEditDMRef.value.show()
}

// 福分发放
const sendScore = () => {
  sendScoreDrawer.value.show()
}

</script>

<style lang="less">
    .block {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-right: 10px;
      .img {
        width: 60px;
        height: 60px;
        border-radius: 10px;
      }
      .title {
        padding: 0 5px;
        box-sizing: border-box;
      }
    }
.container {
  .col {
    display: flex;

  }
}
</style>
